Production Logic In Test ^^^^^ **Definition:** * Some forms of Conditional Test Logic are found in the result verification section of our tests. **Code Example:** .. code-block:: java public void testCombinationsOfInputValues() { // Set up fixture Calculator sut = new Calculator(); int expected; // TBD inside loops for (int i = 0; i < 10; i++) { for (int j = 0; j < 10; j++) { // Exercise SUT int actual = sut.calculate( i, j ); // Verify result if (i==3 & j==4) // special case expected = 8; else expected = i+j; assertEquals(message(i,j), expected, actual); } } } private String message(int i, int j) { return "Cell( " + String.valueOf(i)+ "," + String.valueOf(j) + ")"; } **References:** .. admonition:: Quality attributes * :octicon:`file-code;1em` - Code Example * :octicon:`comment-discussion;1em` - Cause and Effect * :octicon:`graph;1em` - Frequency * :octicon:`sync;1em` - Refactoring * `xUnit test patterns: Refactoring test code `_ :octicon:`file-code;1em` :octicon:`comment-discussion;1em` :octicon:`sync;1em`